package com.kaikeba.servlet.handlermapping.impl;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.kaikeba.servlet.handler.UserAddHandler;
import com.kaikeba.servlet.handler.UserDelHandler;
import com.kaikeba.servlet.handlermapping.HandlerMapping;

public class SimpleHandlerMapping implements HandlerMapping{
	
	private Map<String,Object>mapping= new HashMap<>();

	
	public SimpleHandlerMapping() {
		mapping.put("/addUser", new UserAddHandler());
		mapping.put("/delUser", new UserDelHandler());
	}


	@Override
	public Object getHandler(HttpServletRequest request) {
		String uri = request.getRequestURI();
		return mapping.get(uri);
	}

}
